Re: [SQL] RETURN VALUES ON INTEGERS - Mailing list pgsql-sql

From Herouth Maoz
Subject Re: [SQL] RETURN VALUES ON INTEGERS
Date
Msg-id l03130303b3a8fdf5f0d5@[147.233.159.109]
Whole thread Raw
In response to RETURN VALUES ON INTEGERS  (Alessandro Rossi <alex@sunrise.radiostudiodelta.it>)
List pgsql-sql
At 15:24 +0300 on 07/07/1999, Alessandro Rossi wrote:


> I GET:
>
> id|code|status
> --+------+------
>  1| 44111|N
>  2|   123|S
>
> BUT I WOULD LIKE TO GET
>
> id|code|status
> --+------+------
>  1|044111|N
>  2|000123|S
>
> How could I fix the prbolem and get the values as I ned them out of the
> select ?

Try lpad. For example:

testing=> select num, lpad( num, 6, '0' ) from test1;  num|  lpad
------+------    2|000002    4|000004   38|000038  199|000199
100399|100399
(5 rows)

Herouth

--
Herouth Maoz, Internet developer.
Open University of Israel - Telem project
http://telem.openu.ac.il/~herutma




pgsql-sql by date:

Previous
From: Alessandro Rossi
Date:
Subject: RETURN VALUES ON INTEGERS
Next
From: "John Ridout"
Date:
Subject: RE: [SQL] RETURN VALUES ON INTEGERS